package com.macro.mall.dao;

import com.macro.mall.bean.entity.OdrOrder;
import com.macro.mall.bean.vo.QueryOdrOrderReqVO;
import com.macro.mall.mapper.OdrOrderMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public class OdrOrderDao {

    @Autowired
    OdrOrderMapper mapper;

    public OdrOrder selectByPrimaryKey(String orderId) {
        return mapper.selectByPrimaryKey(orderId);
    }

    public List<OdrOrder> listByModel(OdrOrder model) {
        return mapper.select(model);
    }

    public int insert(OdrOrder model) {
        return mapper.insertSelective(model);
    }

    public int update(OdrOrder model) {
        return mapper.updateByPrimaryKeySelective(model);
    }

    public int deleteByOrderId(Long orderId) {
        return mapper.deleteByPrimaryKey(orderId);
    }

    public int batchInsert(List<OdrOrder> odrOrderList){
        return mapper.insertList(odrOrderList);
    }

    public List<OdrOrder> queryOdrOrderList(QueryOdrOrderReqVO queryOdrOrderReqVO) {
        return mapper.queryOdrOrderList(queryOdrOrderReqVO);
    }
}
